package com.yami.shop.cp.comment.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yami.shop.cp.comment.dao.CollaborativeSubmitPersonMapper;
import com.yami.shop.cp.comment.model.CollaborativeSubmitPerson;
import com.yami.shop.cp.comment.service.CollaborativeSubmitPersonService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xch
 * @since 2021-06-24
 */
@Service
@AllArgsConstructor
public class CollaborativeSubmitPersonServiceImpl extends ServiceImpl<CollaborativeSubmitPersonMapper, CollaborativeSubmitPerson> implements CollaborativeSubmitPersonService {

    private CollaborativeSubmitPersonMapper collaborativeSubmitPersonMapper;

    @Override
    public void updateCSPByCPIdAndMobile(String collaborativePurchaseId, String mobile) {
        CollaborativeSubmitPerson collaborativeSubmitPerson =  collaborativeSubmitPersonMapper.selectCSPByCPIdAndMobile(collaborativePurchaseId,mobile);
        // 状态改为1 已提报，后面有时间改为Enum获取
        collaborativeSubmitPerson.setReserved("1");
        collaborativeSubmitPersonMapper.updateById(collaborativeSubmitPerson);
    }
}
